import type { Executor } from '../';
import type { LoginReq, SaTokenInfo } from '../model/static';

export class AuthController {
    
    constructor(private executor: Executor) {}
    
    async token(options: AuthControllerOptions['token']): Promise<
        SaTokenInfo
    > {
        let _uri = '/auth/token';
        return (await this.executor({uri: _uri, method: 'POST', body: options.body})) as SaTokenInfo
    }
}

export type AuthControllerOptions = {
    'token': {readonly body: LoginReq}
}